function  judge_final=judgement(location_TU,P,location_RU,location_EOC,DT)
judge_final=1;%初始化
%创建邻接矩阵
M=size(location_RU,1)+1;
distance=pdist([location_TU(1,:);location_RU;location_EOC]);  %任务点1
distance(distance>DT)=0;% 大于20KM,断开路径可能性
adjMatrix=squareform(distance);
adjMatrix(:,1)=0; %第一列等于0

% 判断是否有效且连通
result_i=RDFS(adjMatrix,1);
judge_final=result_i&judge_final;
if  judge_final==0 %直接返回
	return 
end

if P>1
    adjMatrix_2=adjMatrix;
	adjMatrix_2(M,:)= adjMatrix(1,:);% EOC被替换成任务点1
	for i=2:P  %任务点2到P
		temp_X=location_TU(i,:);
        temp_Y=[temp_X;location_RU;location_TU(1,:)];
		adjMatrix_2(1,:)=pdist2(temp_Y,temp_X)';
        
        result_i=RDFS(adjMatrix_2,P);
        judge_final=result_i&judge_final;
        if  judge_final==0 %直接返回
            return 
        end
	end
end

end
